﻿@{
    ViewBag.Title = "在线调试页面";
    Layout = "~/Views/Shared/_LayoutTest.cshtml";
}
@section Css{
    <link href="~/Content/themes/web/control.css" rel="stylesheet" />
    <style type="text/css">
        body {
            background-color: #d9d9d9;
        }

        #PageContainer {
            margin: 0px auto;
            width: 1102px;
        }

        #ifrPage {
            width: 760px;
            min-height: 400px;
            border: 1px solid #666;
            background-color: #fff;
            overflow-x: scroll;
        }

        p {
            margin-top: 10px;
            color: #0094ff;
        }

        .form-control {
            width: 100%;
            color: #bd4322;
        }

        hr {
            border-color: #666;
        }
    </style>
}
@section Js{
    <script src="~/Content/scripts/web/valid.js"></script>
    <script type="text/javascript">
        $(function () {
            var pageHeight = $(document).height();
            $("#ifrPage").css("height", (pageHeight - 150) + "px");
            $("#PageContainer").animate({ marginTop: "75px" }, "slow");
        });
        function goLink() {
            var url = $("#txtUrl").val();
            var merchant = $("#txtMerchant").val();
            var accountID = $("#txtAccountID").val();
            var memberID = $("#txtMemberID").val();

            if (url != "" && merchant != "" && accountID != "" && memberID != "") {
                $.get("/home/TestKey/" + merchant + "/" + accountID + "/" + memberID + "/?key=evisa99&gmt=" + Math.random(), function (data) {
                    $("#ifrPage").attr("src", url + "/" + merchant + "/" + accountID + "/" + memberID + "/?key=" + data);
                });
            } else {
                alert("4个空都要输入")
            }
        }
        function getID(ctl) {
            $.get("/home/TestID/?key=evisa99&gmt=" + Math.random(), function (data) {
                $("#" + ctl).val(data);
            });
        }
        function goGrab() {
            var url = window.frames[0].location.href;
            $("#grabUrl").text(url);
        }
    </script>
}

<ul id="PageContainer">
    <li style="width:762px;">
        <iframe id="ifrPage" name="ifrPage" frameborder="0" scrolling="auto" src="/Home/NoAllowed"></iframe>
    </li>
    <li style="padding-left:20px;width:300px;">
        <div>width: 760px</div>
        <hr />
        <p>网址</p>
        <div><input type="text" id="txtUrl" name="txtUrl" class="form-control" value="/Start" /></div>
        <p>Merchant</p>
        <div><input type="text" id="txtMerchant" name="txtMerchant" class="form-control" value="EVISA" /></div>
        <p>AccountID</p>
        <div><input type="text" id="txtAccountID" name="txtAccountID" class="form-control" /></div>
        <div style="text-align:right"><span onclick="getID('txtAccountID');" style="cursor:pointer;">[随机ID]</span></div>
        <p>MemberID</p>
        <div><input type="text" id="txtMemberID" name="txtMemberID" class="form-control" /></div>
        <div style="text-align:right"><span onclick="getID('txtMemberID');" style="cursor:pointer;">[随机ID]</span></div>
        <p><input type="button" class="PrimaryButton" value="连接网址" onclick="goLink();" /></p>
        <hr />
        <p><input type="button" class="LessButton" value="抓取网址" onclick="goGrab();" /></p>
        <p id="grabUrl">@ViewBag.GrabUrl</p>
        <hr />
        <div>CONN: @ViewBag.CONN</div>
        <div>DB_VER: @ViewBag.DB_VER</div>
        <div>AUTH_VER: @ViewBag.AUTH_VER</div>
    </li>
</ul>